import { isHidden } from "vant/lib/utils";
import { createRouter, createWebHashHistory } from "vue-router";
const defRoutes = [
  {
    path: "/",
    redirect: "/login",
  },
  {
    name: "login",
    path: "/login",
    component: () => import("@/views/login/login.vue"),
  },
];
export const routes = [
  {
    path: "/home",
    name: "Home",
    redirect: "/comCenter",
    meta: { title: "系统首页", icon: "icon-xianxingtubiaozhizuomoban-47" },
    children: [
      {
        path: "/comCenter",
        component: () => import("@/views/home/comCenter.vue"),
        name: "ComCenter",
        meta: { title: "账户中心" },
      },
      {
        path: "/artDetail",
        isHidden: true,
        component: () => import("@/views/home/artDetail.vue"),
        name: "artDetail",
        meta: { title: "公告详情" },
      },
    ],
  },
  {
    path: "/work",
    name: "work",
    redirect: "/workList",
    meta: { title: "培训管理", icon: "icon-gangwei" },
    children: [
      {
        path: "/workList",
        component: () => import("@/views/work/workList.vue"),
        name: "WorkList",
        meta: { title: "培训列表", icon: "icon-gangwei" },
      },
      {
        path: "/workListAdd",
        isHidden: true,
        component: () => import("@/views/work/workList/workListAdd.vue"),
        name: "WorkListAdd",
        meta: { title: "发布培训" },
      },
      {
        path: "/workListDetail",
        isHidden: true,
        component: () => import("@/views/work/workList/workListDetail.vue"),
        name: "WorkListDetail",
        meta: { title: "培训详情" },
      },
      {
        path: "/workSign",
        component: () => import("@/views/work/workSign.vue"),
        name: "WorkSign",
        meta: { title: "报名记录", icon: "icon-baoming" },
      },
      {
        path: "/workSignDetail",
        isHidden: true,
        component: () => import("@/views/work/workSign/workSignDetail.vue"),
        name: "WorkSignDetail",
        meta: { title: "培训报名详情" },
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes: defRoutes.concat(routes),
});

export default router;
